package edu.sfsu.powerrangers.jeopardy.gamestate;

import java.io.Serializable;

public class Contestant implements Cloneable, Serializable {
	private static final long serialVersionUID = 1L;
	
	private String name;
	private int score;
	private boolean introduced;
	private String response;
	private boolean responseRevealed;
	private int wager;
	private boolean wagerRevealed;
	
	public Contestant(String name, int initialScore) {
		this.name = name;
		this.score = initialScore;
		this.introduced = false;
		this.response = null;
		this.responseRevealed = false;
		this.wager = 0;
		this.wagerRevealed = false;
	}
	
	public Contestant clone() {
		return new Contestant(name, score);
	}
	
	public String getName() {
		return name;
	}
	
	public int getScore() {
		return score;
	}
	
	public void setScore(int score) {
		this.score = score;
	}
	
	public void addScore(int score) {
		this.score += score;
	}
	
	public void subtractScore(int score) {
		this.score -= score;
	}
	
	public boolean isIntroduced() {
		return introduced;
	}
	
	public void introduce() {
		introduced = true;
	}
	
	public boolean hasResponse() {
		return response != null;
	}
	
	public String getResponse() {
		return response;
	}
	
	public void setResponse(String response) {
		this.response = response;
		this.responseRevealed = false;
	}
	
	public boolean isResponseRevealed() {
		return responseRevealed;
	}
	
	public void revealResponse() {
		responseRevealed = true;
	}
	
	public boolean hasWager() {
		return wager > 0;
	}
	
	public int getWager() {
		return wager;
	}
	
	public void setWager(int wager) {
		this.wager = wager;
		this.wagerRevealed = false;
	}
	
	public boolean isWagerRevealed() {
		return wagerRevealed;
	}
	
	public void revealWager() {
		wagerRevealed = true;
	}
}
